CircleObjectCreater = class(SimpleObjectCreater)

function CircleObjectCreater:init(id,name,tex,icon)
    SimpleObjectCreater.init(self,id,name,tex,icon)
end

-- 此方法设置了普通创建时的半径
function CircleObjectCreater:setSimpleRadius(radius)
    self.simpleRadius = radius
    return self
end

function CircleObjectCreater:createBody(x,y,angle,radius,...)
    local body = physics.body(CIRCLE,radius or self.simpleRadius)
    self:startCreating(body)
    body.x = x
    body.y = y
    body.angle = angle or 0
    body.id = self.id
    body.tex = self.tex
    body.draw = self.draw
    body.interpolate = true
    
    body.renderXOffset = self.renderXOffset
    body.renderYOffset = self.renderYOffset
    
    for k,v in pairs(self.parameter) do
        body[k] = v
    end
    
    self:createFunction(body,...)
    
    return body
end

-- 此方法可能需要重写
function CircleObjectCreater:createFunction(body,...)
    
end

-- 此方法的self指一个body实例
function CircleObjectCreater:draw()
    pushMatrix()
    translate(self.x, self.y)
    rotate(self.angle)
    sprite(self.tex,self.renderXOffset,self.renderYOffset,self.radius * 2,self.radius * 2)
    popMatrix()
end

function CircleObjectCreater:touched(touch)
    
end
